package com;

import java.awt.*;

public class OtherPlane {
    Image image;
    int y = -200;
    int x = 0;
    public OtherPlane(){
        this.x = (int)(Math.random()*600);
        image = ImageIOUtils.getImage(this,"images/enemy3.png");
    }

    public void draw(Graphics graphics) {
        graphics.drawImage(image,this.x,this.y,null);
        //让敌机自己移动
        y = y + 5;
    }

    public Rectangle getRectangle(){
        return new Rectangle(x,y,image.getWidth(null),image.getHeight(null));
    }
}
